<template>
  <u-popup :closeOnClickOverlay="true" :show="show" bgColor="transparent" mode="center" round="10px">
    <view class="recharge-success">
      <image class="title" src="/pages3/static/recharge-title.png" mode="scaleToFill" />
      <div class="info">
        <div class="integral">+{{ integral }}积分</div>
        <div class="text">可用积分</div>
        <div class="my">{{ getUserInfo.integral }}积分</div>
      </div>
      <div class="card">
        <div class="c-info c-info-phone">
          <div class="name">拨打电话</div>
        </div>
        <div class="c-info c-info-top">
          <div class="name">置顶加急</div>
        </div>
        <div class="c-info c-info-refresh">
          <div class="name">刷新信息</div>
        </div>
      </div>

      <div class="operate" @click="submit">我知道了</div>
    </view>
  </u-popup>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "RechargeSuccess",
  props: {
    show: {
      type: Boolean,
      default: true,
    },
    integral: {
      type: Number,
      default: 0,
    },
  },
  computed: {
    ...mapGetters("user", ["getUserInfo"]),
  },
  methods: {
    submit() {
      this.$back();
    },
  },
};
</script>

<style scoped lang="scss">
.recharge-success {
  width: calc(100vw - 100px);
  background: #fff;
  border-radius: 10px;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  .title {
    width: 154px;
    height: 24px;
  }
  .info {
    width: calc(100% - 40px);
    box-sizing: border-box;
    background: url("@/pages3/static/recharge-icon.png");
    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    margin: 0 20px;
    margin-top: 15px;
    padding: 12px 16px;
    height: 118px;
    display: flex;
    flex-direction: column;
    .integral {
      width: 100px;
      height: 32px;
      line-height: 32px;
      text-align: center;
      padding: 2px 8px;
      font-size: 18px;
      font-weight: 600;
      border-radius: 5px;
      background: #ffffff;
      color: #ff8822;
    }
    .text {
      line-height: 24px;
      font-size: 10px;
      color: #ffffff;
    }
    .my {
      font-size: 18px;
      color: #ffffff;
      font-weight: 600;
    }
  }
  .card {
    margin-top: 10px;
    width: calc(100% - 40px);
    display: flex;
    justify-content: space-between;
    .c-info {
      height: 73px;
      width: 72px;
      display: flex;
      align-items: center;
      font-size: 10px;
      color: #ff8822;
      background-position: center;
      background-repeat: no-repeat;
      .name {
        width: 100%;
        text-align: center;
        margin-top: 40px;
      }
    }
    .c-info-phone {
      background-image: url("@/pages3/static/recharge-card-phone.png");
      background-size: 100% 100%;
    }
    .c-info-top {
      color: #2c9cfd;
      background-image: url("@/pages3/static/recharge-card-top.png");
      background-size: 100% 100%;
    }
    .c-info-refresh {
      background-image: url("@/pages3/static/recharge-card-refresh.png");
      background-size: 100% 100%;
    }
  }
  .operate {
    width: 210px;
    height: 40px;
    margin: 0 auto;
    margin-top: 20px;
    line-height: 40px;
    border-radius: 20px;
    background: linear-gradient(270deg, #ffa222 0%, #ff8822 100%);
    text-align: center;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
  }
}
</style>
